class FuzzySet{
    protected String label;
    protected float a, b, c, d;
    
    public FuzzySet(String label){
	this.label = label;	
    }
    public FuzzySet(String label, float a, float b, float c, float d){
	this.label = label;	
	this.a = a;
	this.b = b;
	this.c = c;
	this.d = d;
    }//end constructor
    
    public String getLabel(){return this.label;}
    public float getA(){return this.a;}
    public float getB(){return this.b;}
    public float getC(){return this.c;}
    public float getD(){return this.d;}
    
    public float membershipValue(float value){
       
	if(value >= b && value<= c)
	    return 1;			
	else if(value >= a && value<= b)
	    return (value-a)/(b-a);		
	else if(value >= c && value<= d)
	    return (d-value)/(d-c);
	else
	    return 0;

    }//end membership value
}//end class
